<template>
    <div class="section-wrap crosswork">
        <div class="form-section">
            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>项目名称</label>
                </div>
                <div class="newcompanyList approvehide">
                    <!-- {{dataList.projectName}} -->
                    {{userInfo.departsir == 2?userInfo.pdeptname:dataList.projectName}}
                </div>
            </div>

            <div class="form-item form-item-style1"
                 @click="showclass">
                <div class="label-title">
                    <label>申请单位</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.deptName?dataList.deptName:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style1"
                 @click="showArea">
                <div class="label-title">
                    <label>高风险作业区域</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.areaName?dataList.areaName:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>作业开始日期</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime :start-date="showDate"
                              v-model="dataList.StartDate"
                              format="YYYY-MM-DD"
                              @on-confirm="changeStartTime"></datetime>
                </group>
            </div>

            <!-- <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>作业开始日期</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="newcompanyList approvehide">
                    {{dataList.StartDate}}
                </div>
            </div> -->

            <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>作业结束日期</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <datetime :start-date="showDateEnd"
                              v-model="dataList.EndDate"
                              @on-confirm="changeEndTime"></datetime>
                </group>
            </div>
        </div>
        <div class="form-section">
            <div class="saveFiretit">
                作业单位1
            </div>

            <div class="form-item form-item-style1"
                 @click="showUnit">
                <div class="label-title">
                    <label>作业单位</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.WorkUnit1?dataList.WorkUnit1:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>
            <!-- <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>作业单位</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select"
                     @click="selectType">
                     {{$store.state.checkClass.Name?$store.state.checkClass.Name:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div> -->

            <div class="form-item form-item-style1"
                 @click="showCrossView">
                <div class="label-title">
                    <label>作业内容</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.WorkRemork1?dataList.WorkRemork1:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>
            <!-- <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>作业内容</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <popup-picker :data="detailData[0].maskwork"
                                  v-model="workcontent1"
                                  placeholder="请选择"></popup-picker>
                </group>
            </div> -->

            <div class="form-item form-item-style1"
                 @click="showMonitorview">
                <div class="label-title">
                    <label>作业监督负责人</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.WorkSupervisor1?dataList.WorkSupervisor1:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <!-- <div class="form-item form-item-style1">
                <div class="label-title">
                    <label>作业监督负责人</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <group>
                    <popup-picker :data="detailData[0].monitorman"
                                  v-model="tastman1"
                                  placeholder="请选择"></popup-picker>
                </group>
            </div> -->

            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>联系电话</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div>
                    <x-textarea :height="30"
                                v-model="dataList.ContactNum1"></x-textarea>
                </div>
            </div>
        </div>
        <div class="form-section">
            <div class="saveFiretit">
                作业单位2
            </div>

            <div class="form-item form-item-style1"
                 @click="showUnit2">
                <div class="label-title">
                    <label>作业单位</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.WorkUnit2?dataList.WorkUnit2:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style1"
                 @click="showCrossView2">
                <div class="label-title">
                    <label>作业内容</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.WorkRemork2?dataList.WorkRemork2:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style1"
                 @click="showMonitorview2">
                <div class="label-title">
                    <label>作业监督负责人</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div class="right-select">
                    {{dataList.WorkSupervisor2?dataList.WorkSupervisor2:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>联系电话</label>
                    <i class="iconfont icon-required"></i>
                </div>
                <div>
                    <x-textarea :height="30"
                                v-model="dataList.ContactNum2"></x-textarea>
                </div>
            </div>
        </div>

        <div class="form-section">
            <div class="saveFiretit">
                作业单位3
            </div>

            <div class="form-item form-item-style1"
                 @click="showUnit3">
                <div class="label-title">
                    <label>作业单位</label>
                </div>
                <div class="right-select">
                    {{dataList.WorkUnit3?dataList.WorkUnit3:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style1"
                 @click="showCrossView3">
                <div class="label-title">
                    <label>作业内容</label>
                </div>
                <div class="right-select">
                    {{dataList.WorkRemork3?dataList.WorkRemork3:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style1"
                 @click="showMonitorview3">
                <div class="label-title">
                    <label>作业监督负责人</label>
                </div>
                <div class="right-select">
                    {{dataList.WorkSupervisor3?dataList.WorkSupervisor3:'请选择'}}
                    <i class="iconfont icon-jinru rightmsg"></i>
                </div>
            </div>

            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>联系电话</label>
                </div>
                <div>
                    <x-textarea :height="30"
                                v-model="dataList.ContactNum3"></x-textarea>
                </div>
            </div>

            <div class="form-item form-item-style2">
                <div class="label-title">
                    <label>施工员协调意见</label>
                </div>
                <div>
                    <x-textarea :placeholder="('请输入意见(自动换行)')"
                                :max="2000"
                                :height="50"
                                v-model="dataList.remark"></x-textarea>
                </div>
            </div>

            <!-- 审批信息 -->
            <div class="approveBox"
                 v-if='approveStatus'>
                <div class="approveTit">审批信息</div>
                <div class="approveWrap"
                     v-if='dataList.ApproveInfo.length>0'
                     v-for="(item,index) in dataList.ApproveInfo"
                     :key="index">
                    <div class="form-item form-item-style2">
                        <div class="label-title">
                            <label>审批意见</label>
                        </div>
                        <div>
                            <textarea class="areainfo"
                                      height="500"
                                      placeholder="请输入审批意见"
                                      v-model="item.Remark"
                                      :disabled="isDisable"></textarea>
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>审批结论</label>
                        </div>
                        <div class="newcompanyList approvehide">
                            {{item.ApproveResult}}
                        </div>
                    </div>
                    <div class="form-item form-item-style1">
                        <div class="label-title">
                            <label>审批人</label>
                        </div>
                        <div class="newcompanyList approvehide">
                            {{item.ApprovePersonName}}
                        </div>
                    </div>
                </div>
            </div>

            <div class="btns"
                 v-if="syself">
                <button @click="toSubmit">提交</button>
            </div>
        </div>

        <!--获取申请单位-->
        <div v-transfer-dom>
            <popup v-model="classValue"
                   width="100%">
                <div class="newlist">
                    <lookcompany></lookcompany>
                </div>
            </popup>
        </div>

        <!--获取区域-->
        <div v-transfer-dom>
            <popup v-model="areaValue"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in areaList"
                     :key="index"
                     @click="selectArea(item)">
                    <span class="vux-close">
                        {{item.name}}
                    </span>
                </div>
            </popup>
        </div>

        <!--获取作业单位1-->
        <div v-transfer-dom>
            <popup v-model="unitValue"
                   width="100%">
                <div class="newlist newlist1">
                    <lookcompanys :key="1"
                                  v-show="unitValue"></lookcompanys>
                </div>
            </popup>
        </div>

        <!--获取作业单位2-->
        <div v-transfer-dom>
            <popup v-model="unitValue2"
                   width="100%">
                <div class="newlist newlist2">
                    <lookcompanys2 :key="2"></lookcompanys2>
                </div>
            </popup>
        </div>

        <!--获取作业单位3-->
        <div v-transfer-dom>
            <popup v-model="unitValue3"
                   width="100%">
                <div class="newlist newlist3">
                    <lookcompanys3 :key="3"></lookcompanys3>
                </div>
            </popup>
        </div>

        <!-- 获取作业监督负责人1 -->
        <div v-transfer-dom>
            <popup v-model="monitorValue"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in monitorList"
                     :key="index"
                     @click="selectMonitorList(item)">
                    <span class="vux-close">
                        {{item.realName}}
                    </span>
                </div>
            </popup>
        </div>

        <!-- 获取作业监督负责人2 -->
        <div v-transfer-dom>
            <popup v-model="monitorValue2"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in monitorList2"
                     :key="index"
                     @click="selectMonitorList2(item)">
                    <span class="vux-close">
                        {{item.realName}}
                    </span>
                </div>
            </popup>
        </div>

        <!-- 获取作业监督负责人3 -->
        <div v-transfer-dom>
            <popup v-model="monitorValue3"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in monitorList3"
                     :key="index"
                     @click="selectMonitorList3(item)">
                    <span class="vux-close">
                        {{item.realName}}
                    </span>
                </div>
            </popup>
        </div>

        <!-- 获取作业内容1 -->
        <div v-transfer-dom>
            <popup v-model="crossValue"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in crossConList"
                     :key="index"
                     @click="selectCrossList(item)">
                    <span class="vux-close">
                        {{item.DeptName}}
                    </span>
                </div>
            </popup>
        </div>

        <!-- 获取作业内容2 -->
        <div v-transfer-dom>
            <popup v-model="crossValue2"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in crossConList2"
                     :key="index"
                     @click="selectCrossList2(item)">
                    <span class="vux-close">
                        {{item.DeptName}}
                    </span>
                </div>
            </popup>
        </div>

        <!-- 获取作业内容3 -->
        <div v-transfer-dom>
            <popup v-model="crossValue3"
                   width="100%">
                <div class="position-horizontal-demo"
                     v-for="(item,index) in crossConList3"
                     :key="index"
                     @click="selectCrossList3(item)">
                    <span class="vux-close">
                        {{item.DeptName}}
                    </span>
                </div>
            </popup>
        </div>

        <myMenu></myMenu>
    </div>
</template>
<script>
import myMenu from '@/commonComponents/menu'
import lookcompany from '../weightwork/lookcompany'
import lookcompanys from './lookcompany'
import lookcompanys2 from './lookcompany2'
import lookcompanys3 from './lookcompany3'
import { Popup, TransferDom } from 'vux'
import mixin from '../commonmixin.js'
export default {
    components: {
        myMenu,
        Popup,
        lookcompany,
        lookcompanys,
        lookcompanys2,
        lookcompanys3
    },
    mixins: [mixin],
    directives: {
        TransferDom
    },
    computed: {
        changedatas () {
            return this.$store.state.workrist1
        },
        changedatas2 () {
            return this.$store.state.workrist2
        },
        changedatas3 () {
            return this.$store.state.workrist3
        }
    },
    watch: {
        changedatas () {
            this.unitValue = false
            this.dataList.WorkUnit1 = this.$store.state.companyworklist.FireSquad
        },
        changedatas2 () {
            this.unitValue2 = false
            this.dataList.WorkUnit2 = this.$store.state.companyworklist2.FireSquad
        },
        changedatas3 () {
            this.unitValue3 = false
            this.dataList.WorkUnit3 = this.$store.state.companyworklist3.FireSquad
        }
    },
    data () {
        return {
            dataList: {
                id: '', // String		受限空间作业申请ID（修改时存在，新增时为空）
                projectName: '', // String		项目名称
                projectId: '', // String		项目ID
                deptName: '', // String		申请单位名称
                deptId: '', // String		申请单位ID
                areaId: '', // String		高风险作业区域id
                areaName: '', // String		高风险作业区域
                StartDate: this.getDate(), // String		作业开始时间
                EndDate: this.getDate(), // String		作业结束时间
                WorkUnit1: '', // 作业单位1
                WorkUnit2: '', // 作业单位2
                WorkUnit3: '', // 作业单位3
                WorkSupervisor1: '', // 作业监督负责人1
                WorkSupervisor2: '', // 作业监督负责人2
                WorkSupervisor3: '', // 作业监督负责人3
                WorkRemork1: '', // 主要作业内容1
                WorkRemork2: '', // 主要作业内容2
                WorkRemork3: '', // 主要作业内容3
                ContactNum1: '', // 联系方式1
                ContactNum2: '', // 联系方式2
                ContactNum3: '', // 联系方式3
                remark: ''// 施工员协调意见
            },
            unitValue: false, // 作业单位弹窗1是否显示
            unitList: [], // 作业单位列表数据1
            unitValue2: false, // 作业单位弹窗2是否显示
            unitList2: [], // 作业单位列表数据2
            unitValue3: false, // 作业单位弹窗3是否显示
            unitList3: [], // 作业单位列表数据3
            monitorValue: false, // 监督负责人1是否显示
            monitorList: [], // 监督负责人1列表数据
            monitorValue2: false, // 监督负责人2弹窗是否显示
            monitorList2: [], // 监督负责人列表2数据
            monitorValue3: false, // 监督负责人3弹窗是否显示
            monitorList3: [], // 监督负责人列表3数据
            crossValue: false, // 作业内容弹窗是否显示
            crossConList: [], // 作业内容数据
            crossValue2: false, // 作业内容弹窗2是否显示
            crossConList2: [], // 作业内容数据2
            crossValue3: false, // 作业内容弹窗3是否显示
            crossConList3: [], // 作业内容数据3
            isDisable: true,
            checkStatusList: [], // 已选安全措施集合
            userId: '',
            tokenId: '',
            projectId: '',
            userInfo: {},
            showDate: this.getDate(), // 作业开始时间最小日期
            showDateEnd: this.getDate(), // 作业结束时间最小日期
            addFlag: true, // 提交开关（避免多次提交）
            approveStatus: false, // 是否展示审批信息
            syself: true
        }
    },
    created () {
        //     console.log(this.changedatas)
        this.userInfo = JSON.parse(localStorage.userInfo)
        this.dataList = Object.assign({}, this.dataList, {
            projectName: this.userInfo.deptname,
            deptName: this.userInfo.deptname,
            deptId: this.userInfo.deptid
        })
        this.getArea()
        this.getsblist()
        this.getCrossContent()
        if (this.$route.query.id) {
            this.getdetail()
        }
    },
    methods: {
        getdetail () {
            let param = {
                'allowPaging': true,
                'business': 'GetCrossJob',
                'data': {
                    'id': this.$route.query.id
                },
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.tokenId,
                'userId': this.userId
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    let newarr = res.data.data
                    this.dataList = {
                        id: newarr.Id,
                        projectName: newarr.ProjectName, //	String	否	项目名称
                        projectId: newarr.ProjectId,
                        deptName: newarr.DeptName, //	String	否	申请单位名称
                        deptId: newarr.DeptId, //	String	否	申请单位ID
                        areaId: newarr.AreaId, // String		高风险作业区域id
                        areaName: newarr.AreaName, // String		高风险作业区域
                        StartDate: newarr.StartDate, // String		作业开始时间
                        EndDate: newarr.EndDate, // String		作业结束时间
                        WorkUnit1: newarr.WorkUnit1, // 作业单位1
                        WorkUnit2: newarr.WorkUnit2, // 作业单位2
                        WorkUnit3: newarr.WorkUnit3, // 作业单位3
                        WorkSupervisor1: newarr.WorkSupervisor1, // 作业监督负责人1
                        WorkSupervisor2: newarr.WorkSupervisor2, // 作业监督负责人2
                        WorkSupervisor3: newarr.WorkSupervisor3, // 作业监督负责人3
                        WorkRemork1: newarr.WorkRemork1, // 主要作业内容1
                        WorkRemork2: newarr.WorkRemork2, // 主要作业内容2
                        WorkRemork3: newarr.WorkRemork3, // 主要作业内容3
                        ContactNum1: newarr.ContactNum1, // 联系方式1
                        ContactNum2: newarr.ContactNum2, // 联系方式2
                        ContactNum3: newarr.ContactNum3, // 联系方式3
                        remark: newarr.remark, // 施工员协调意见
                        ApproveInfo: newarr.ApproveInfo
                    }
                    if (this.dataList.StartDate) {
                        this.$set(this.dataList, 'StartDate', this.dataList.StartDate.substring(0, 10))
                    }
                    if (this.dataList.EndDate) {
                        this.$set(this.dataList, 'EndDate', this.dataList.EndDate.substring(0, 10))
                    }

                    this.syself = res.data.data.CanEdit
                    if (res.data.data.ApproveInfo.length > 0) {
                        this.approveStatus = true
                    }
                }
            )
        },
        // 选择高风险作业区域
        selectArea (item) {
            //  this.areaname = item.name;
            this.dataList.areaName = item.name
            this.dataList.areaId = item.id
            this.areaValue = false
        },
        // 点击显示作业单位弹窗
        showUnit () {
            this.unitValue = true
        },
        // 点击显示作业单位弹窗2
        showUnit2 () {
            this.unitValue2 = true
        },
        // 点击显示作业单位弹窗3
        showUnit3 () {
            this.unitValue3 = true
        },
        // 获取作业监督负责人数据
        getsblist () {
            let param = {
                'allowPaging': true,
                'business': 'GetDivderPeopleList',
                'data': {
                    'departId': this.userInfo.deptid
                },
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userId
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.monitorList = res.data.data
                    this.monitorList2 = res.data.data
                    this.monitorList3 = res.data.data
                }
            )
        },
        // 点击显示作业监督负责人弹窗1
        showMonitorview () {
            this.monitorValue = true
        },
        // 选择作业监督负责人1
        selectMonitorList (item) {
            this.dataList.WorkSupervisor1 = item.realName//	String	作业监督负责人
            this.monitorValue = false
        },
        // 点击显示作业监督负责人弹窗2
        showMonitorview2 () {
            this.monitorValue2 = true
        },
        // 选择作业监督负责人2
        selectMonitorList2 (item) {
            this.dataList.WorkSupervisor2 = item.realName//	String	作业监督负责人
            this.monitorValue2 = false
        },
        // 点击显示作业监督负责人弹窗3
        showMonitorview3 () {
            this.monitorValue3 = true
        },
        // 选择作业监督负责人3
        selectMonitorList3 (item) {
            this.dataList.WorkSupervisor3 = item.realName//	String	作业监督负责人
            this.monitorValue3 = false
        },
        // 获取交叉作业内容
        getCrossContent () {
            let param = {
                'allowPaging': true,
                'business': 'GetCrossJobItem',
                'data': {
                    'departId': this.userInfo.deptid
                },
                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.userInfo.tokenId,
                'userId': this.userInfo.userId
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    this.crossConList = res.data.data
                    this.crossConList2 = res.data.data
                    this.crossConList3 = res.data.data
                }
            )
        },
        // 点击显示作业内容弹窗1
        showCrossView () {
            this.crossValue = true
        },
        // 选择作业内容1
        selectCrossList (item) {
            this.dataList.WorkRemork1 = item.DeptName
            this.crossValue = false
        },
        // 点击显示作业内容弹窗2
        showCrossView2 () {
            this.crossValue2 = true
        },
        // 选择作业内容2
        selectCrossList2 (item) {
            this.dataList.WorkRemork2 = item.DeptName
            this.crossValue2 = false
        },
        // 点击显示作业内容弹窗3
        showCrossView3 () {
            this.crossValue3 = true
        },
        // 选择作业内容1
        selectCrossList3 (item) {
            this.dataList.WorkRemork3 = item.DeptName
            this.crossValue3 = false
        },
        // 获取当前年月日
        getDate () {
            let nowDate = new Date()
            let date = {
                year: nowDate.getFullYear(),
                month: nowDate.getMonth() + 1,
                date: nowDate.getDate()
            }
            if (date.month >= 0 && date.month < 10) {
                date.month = '0' + date.month
            }
            if (date.date >= 0 && date.date < 10) {
                date.date = '0' + date.date
            }
            let systemDate = date.year + '-' + date.month + '-' + date.date
            return systemDate || ''
        },
        // 验证开始和结束时间
        checkTime (startTime, endTime, tip) {
            if (startTime.length > 0 && endTime.length > 0) {
                var startTmp = startTime.split('-')
                var endTmp = endTime.split('-')
                var sd = new Date(startTmp[0], startTmp[1], startTmp[2])
                var ed = new Date(endTmp[0], endTmp[1], endTmp[2])
                if (sd.getTime() > ed.getTime()) {
                    // this.$vux.toast.text("开始日期不能大于结束日期");
                    return false
                }
            }
            return true
        },
        // 切换开始时间,结束时间不小于开始时间
        changeStartTime (val) {
            if (!this.checkTime(val, this.dataList.EndDate)) {
                this.$set(this.dataList, 'EndDate', this.dataList.StartDate)
            }
            this.showDateEnd = this.dataList.StartDate
        },
        // 切换结束时间
        changeEndTime (val) {
            if (!this.checkTime(this.dataList.StartDate, val)) {
                this.$set(this.dataList, 'EndDate', this.dataList.StartDate)
            }
        },
        // 提交
        toSubmit () {
            if (!this.dataList.deptName) {
                this.$vux.toast.text('请选择申请单位')
                return false
            }
            if (!this.dataList.areaName) {
                this.$vux.toast.text('请选择作业区域')
                return false
            }
            if (!this.dataList.WorkUnit1 || !this.dataList.WorkUnit2) {
                this.$vux.toast.text('请选择作业单位')
                return false
            }
            if (!this.dataList.WorkRemork1 || !this.dataList.WorkRemork2) {
                this.$vux.toast.text('请输入作业内容')
                return false
            }
            if (!this.dataList.WorkSupervisor1 || !this.dataList.WorkSupervisor2) {
                this.$vux.toast.text('请选择作业监督负责人')
                return false
            }
            if (!this.dataList.ContactNum1 || !this.dataList.ContactNum2) {
                this.$vux.toast.text('请输入联系电话')
                return false
            }
            if (!this.addFlag) {
                return false
            }
            this.addFlag = false
            let sendmethod = 'send'
            // if(this.$route.query.id){
            //     sendmethod = "modify";
            // }
            this.$vux.loading.show({
                text: '正在提交中...'
            })
            let param = {
                'allowPaging': true,
                'business': 'SetCrossJob',
                'method': sendmethod,
                'data': this.dataList,

                'pageIndex': 0,
                'pageSize': 20,
                'tokenId': this.tokenId,
                'userId': this.userId
            }
            this.$axiosAjax.getConfigJson(
                param
            ).then(
                (res) => {
                    if (res.data.code == 0) {
                        this.$vux.toast.text('申请提交成功')
                        this.$router.push('/workrisk')
                    } else {
                        this.$vux.toast.text(res.data.info)
                        this.addFlag = true
                    }
                }
            ).catch(() => {
                this.addFlag = true
            })
        },
        // 安全措施多选
        checkedOne (val) {
            var idIndex = this.checkStatusList.indexOf(val)
            if (idIndex >= 0) {
                this.checkStatusList.splice(idIndex, 1)
            } else {
                this.checkStatusList.push(val)
            }
        },
        selectType () {

        }
    }
}
</script>
<style lang="less" scoped>
.right-select {
    font-size: 14px;
    color: #999;
}
.right-select > i {
    color: #999;
}
.btns .green {
    // background: #15bc84;
}
.newcompanyList {
    font-size: 14px;
    text-align: right;
    color: #999;
}
.saveFiretit {
    height: 45px;
    line-height: 45px;
    border-bottom: 1px solid #efeff4;
    margin-left: 20px;
    color: #2269ff;
    font-size: 15px;
}
.saveChecklist {
    height: 55px;
    line-height: 55px;
    font-size: 13px;
    margin-left: 20px;
    padding-right: 20px;
    border-bottom: 1px solid #efeff4;
}
.saveCheckInp {
    display: inline-block;
    width: 15px;
    height: 15px;
    margin-right: 9px;
    background: #fff url('../../../assets/hideManage/uncheckedicon.jpg')
        no-repeat 0 0;
    background-size: 15px 15px;
}
.saveCheckInp.checkedopt {
    background: #fff url('../../../assets/hideManage/checkedicon.jpg') no-repeat
        0 0;
    background-size: 15px 15px;
}
.select-section {
    display: flex;
    display: -webkit-flex;
    font-size: 14px;
}
.select-section div {
    padding-left: 26px;
    background: url(../../../../static/images/select.png) no-repeat left center;
    background-size: 17px 17px;
}
.select-section div:first-child {
    margin-right: 38px;
}
.select-section .active {
    background: url(../../../../static/images/selected.png) no-repeat left
        center;
    background-size: 17px 17px;
}
.crosswork .form-item label {
    // width: 170px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
</style>
<style>
.crosswork .vux-cell-value {
    color: #999;
}
.crosswork .vux-x-textarea {
    width: 100%;
    border: 0 !important;
}
.crosswork .form-item .textarea,
.crosswork .form-item textarea {
    font-size: 14px;
    color: #999;
    font-family: '微软雅黑';
}
.crosswork .areainfo {
    resize: none;
}
.crosswork .right-select {
    padding-right: 18px;
    overflow: hidden;
    width: 250px;
    position: relative;
    line-height: 5.333vw;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.crosswork .rightmsg {
    color: #c8c8cd;
    position: absolute;
    right: 0;
    top: 0;
}
.position-horizontal-demo {
    height: 55px;
    line-height: 55px;
    padding-left: 20px;
    font-size: 16px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 20px;
    background-color: #fff;
    border-bottom: 1px solid #ebeef3;
}
.crosswork .iconfont {
    margin-right: 0;
}
.crosswork .weui-cell_access .weui-cell__ft:after {
    color: #cdcdd2;
}
.approveBox {
    border-top: 10px solid #ebeef2;
}
.approveBox .approveTit {
    height: 55px;
    line-height: 55px;
    margin-left: 20px;
    font-size: 15px;
    color: #2269ff;
    border-bottom: 1px solid #efeff4;
}
.approveBox .approveWrap {
    border-bottom: 5px solid #ebeef2;
}
.approveBox .approveWrap:last-child {
    /* border: none; */
}
</style>
